/*
package com.tansun.easycare.core.web;

import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

import com.tansun.easycare.core.utils.ResponseJson;



@ControllerAdvice
public class GlobalExceptionHandler {
	  
	  private  Logger  log  = LoggerFactory.getLogger(this.getClass());
	
	
	  @ExceptionHandler(value=Exception.class)
	  @ResponseBody
	  public ResponseJson defaultErrorHandler(HttpServletRequest req, Exception e) throws Exception {
		     log.error("", e);
		     ResponseJson  resVo  = new  ResponseJson();
		     if (e instanceof org.springframework.web.servlet.NoHandlerFoundException) {
		    	 resVo.setCode(404);
	        }
		     else {
		    	resVo.setDescription(e.getMessage()); 
		    	resVo.setMessage(e.getMessage());
	        	resVo.setCode(500);
	        }
		    resVo.setData(null);
		    resVo.setStatus(false);
		    return  resVo;
	  }

}
*/
